package models

import (
	"time"
)

/*
 +----------------------------------------------------------------------
 + Title        : Role
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2018-01-06
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 角色模型
 +----------------------------------------------------------------------
*/
type Role struct {
	Id         uint16    `gorm:"primaryKey;autoIncrement" json:"id"`
	Name       string    `json:"name"`
	IsAdmin    int8      `json:"is_admin"`
	Note       string    `json:"note"`
	Status     int8      `json:"status"`
	CreateTime time.Time `gorm:"autoCreateTime" json:"create_time"`
	UpdateTime time.Time `gorm:"default:null;" json:"update_time"`
	Base       `gorm:"-"`
	IsAssgin   uint8    `gorm:"-" json:"is_assgin"`
	Authes     []Auth   `gorm:"-" json:"authes"`
	AuthIds    []uint16 `gorm:"-"`
}

//设置表名
func (Role) TableName() string {
	return "mall_role"
}
